
package com.sausageking.shared;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Id;

import com.google.common.base.Objects;
import com.google.common.base.Objects.ToStringHelper;
import com.googlecode.objectify.annotation.Indexed;
import com.googlecode.objectify.annotation.Unindexed;

@Unindexed
public class Checkin implements Serializable {

  private static final long serialVersionUID = 4818472978722321416L;

  @Id
  @Indexed
  private Long id;

  @Indexed
  private String userId;

  @Indexed
  private String merchantId;

  private String postId;

  private Date creationTime;

  public Checkin() {
  }

  public Date getCreationTime() {
    return creationTime;
  }

  public void setCreationTime(Date creationTime) {
    this.creationTime = creationTime;
  }

  public Long getId() {
    return id;
  }

  public void setId(Long id) {
    this.id = id;
  }

  public String getUserId() {
    return userId;
  }

  public Checkin setUserId(String userId) {
    this.userId = userId;
    return this;
  }

  public String getMerchantId() {
    return merchantId;
  }

  public Checkin setMerchantId(String merchantId) {
    this.merchantId = merchantId;
    return this;
  }

  public String toString() {
    @SuppressWarnings("deprecation")
    ToStringHelper helper = Objects.toStringHelper(this).add("id", id)
        .add("user", userId).add("merchant", merchantId)
        .add("created", creationTime.toGMTString()).add("postId", postId);
    return helper.toString();
  }

  public String getPostId() {
    return postId;
  }

  public void setPostId(String postId) {
    this.postId = postId;
  }
}
